#!/bin/sh
#clear-passwd {密码} {节点IP}:{节点PORT} {节点IP}:{节点PORT} ...
old_passwd=$1

for ipAndPort in ${@:2}; do

	echo "host:${ipAndPort}"
	
	array=(${ipAndPort//:/ })

	./redis-cli -c -h ${array[0]} -p ${array[1]} -a ${old_passwd} CONFIG SET masterauth ""
	./redis-cli -c -h ${array[0]} -p ${array[1]} -a ${old_passwd} CONFIG SET requirepass ""

done